import request from '@/utils/request'
const baseUrl = '/constellation-correlate-analyse/constellation-correlate-analyse/v1.0/'
const apiAnalysis = {
  satellites: function (params) {
    return request({
      url: baseUrl + 'structure/satellites',
      method: 'get',
      params
    })
  },

  getSelectParams: function (data) {
    return request({
      url: baseUrl + 'structure/params',
      method: 'get',
      params: data
    })
  },
  addParams: function (data) {
    return request({
      url: baseUrl + 'monitor/param/add',
      method: 'post',
      data
    })
  },

  getPageList: function (data) {
    return request({
      url: baseUrl + 'constant/monitor/list',
      method: 'post',
      data
    })
  },
  uploadFile: () => {
    return baseUrl + '/upload'
  },
  // 新增常值监测
  addConstantMonitor: function (data) {
    return request({
      url: baseUrl + 'constant/monitor/add',
      method: 'post',
      data
    })
  },
  // 常值监测查询详情
  getConstantMonitorDetail: function (id) {
    return request({
      url: baseUrl + `constant/monitor/id?id=` + id,
      method: 'get'
    })
  },
  // 常值监测修改
  updateConstantMonitor: function (data) {
    return request({
      url: baseUrl + 'constant/monitor/update',
      method: 'post',
      data
    })
  },
  // 常值监测删除
  deleteConstantMonitor: function (id) {
    return request({
      url: baseUrl + `constant/monitor/delete?id=` + id,
      method: 'get'
    })
  },
  // 常值监测 更新模板状态
  updateConstantMonitorStatus: function (params) {
    return request({
      url: baseUrl + 'constant/monitor/update/state',
      method: 'get',
      params
    })
  },
  // 关联参数信息（分页）
  getRelationParams: function (data) {
    return request({
      url: baseUrl + 'associate/param/pageList',
      method: 'post',
      data
    })
  },
  // 关联参数信息（新增）
  addRelationParams: function (data) {
    return request({
      url: baseUrl + 'associate/param/save',
      method: 'post',
      data
    })
  },
  // 查看关联参数详情
  getRelationParamsDetail: function (id) {
    return request({
      url: baseUrl + `associate/param/detail/${id}`,
      method: 'get'
    })
  },
  // 修改关联参数 (修改)
  updateRelationParams: function (data) {
    return request({
      url: baseUrl + 'associate/param/update',
      method: 'put',
      data
    })
  },
  // 删除关联参数
  deleteRelationParams: function (id) {
    return request({
      url: baseUrl + `associate/param/${id}`,
      method: 'delete'
    })
  },
  // 关联分析 更新模板状态
  updateTemplateStatus: function (params) {
    return request({
      url: baseUrl + 'associate/param/update/state',
      method: 'get',
      params
    })
  },
  // 常值监测算法绑定列表 - 订阅
  getConstantMonitorBinding: function (data) {
    return request({
      url: baseUrl + 'constant/monitor/list/bind',
      method: 'post',
      data
    })
  },
  // 关联参数绑定列表 - 订阅
  getRelationParamsBinding: function (data) {
    return request({
      url: baseUrl + 'associate/param/list/bind',
      method: 'post',
      data
    })
  },
  // 获取常值监测绑定列表
  getConstantMonitorBindingList: function (data) {
    return request({
      url: baseUrl + 'constantParamBind/paramBindingList',
      method: 'get',
      params: data
    })
  },
  // 添加常值监测参数绑定
  addConstantMonitorBinding: function (data) {
    return request({
      url: baseUrl + 'constantParamBind/addConstantParamBind',
      method: 'post',
      data
    })
  },
  // 根据ID获取绑定详情
  getConstantMonitorBindingDetail: function (id) {
    return request({
      url: baseUrl + `constantParamBind/getConstantBindById/${id}`,
      method: 'get'
    })
  },
  // 修改常值监测参数绑定
  updateConstantMonitorBinding: function (data) {
    return request({
      url: baseUrl + 'constantParamBind/updateBindInfo',
      method: 'put',
      data
    })
  },
  // 删除常值监测参数绑定
  deleteConstantMonitorBinding: function (id) {
    return request({
      url: baseUrl + `constantParamBind/removeBinding/${id}`,
      method: 'delete'
    })
  },
  // 获取关联参数绑定列表
  getRelationParamsBindingList: function (data) {
    return request({
      url: baseUrl + 'expression/param/bind/paramBindingList',
      method: 'get',
      params: data
    })
  },
  // 根据卫星ID获取参数列表
  getParamsListBySatelliteId: function (satId) {
    return request({
      url: baseUrl + `expression/param/bind/param/${satId}`,
      method: 'get'
    })
  },
  // 添加关联参数绑定
  addRelationParamsBinding: function (data) {
    return request({
      url: baseUrl + 'expression/param/bind/paramBind',
      method: 'post',
      data
    })
  },
  // 根据id获取绑定详情 - 关联参数
  getRelationParamsBindingDetail: function (id) {
    return request({
      url: baseUrl + `expression/param/bind/getBindById/${id}`,
      method: 'get'
    })
  },
  //  修改关联参数绑定 - 关联参数
  updateRelationParamsBinding: function (data) {
    return request({
      url: baseUrl + 'expression/param/bind/updateBinding',
      method: 'put',
      data
    })
  },
  // 删除关联参数绑定 - 关联参数
  deleteRelationParamsBinding: function (id) {
    return request({
      url: baseUrl + `expression/param/bind/removeBinding/${id}`,
      method: 'delete'
    })
  },
  // 常值监测 订阅 列表
  getConstantMonitorSubscribeList: function (data) {
    return request({
      url: baseUrl + 'constantParamBind/bindingPage',
      method: 'get',
      params: data
    })
  },
  // 关联参数 订阅 列表
  getRelationParamsSubscribeList: function (data) {
    return request({
      url: baseUrl + 'expression/param/bind/bindingPage',
      method: 'get',
      params: data
    })
  },
  // 时序数据计算 分页列表
  getSequenceDataList: function (data) {
    return request({
      url: baseUrl + 'timeSeries/param/pageList',
      method: 'post',
      data
    })
  },
  // 时序数据计算 添加
  addSequenceData: function (data) {
    return request({
      url: baseUrl + 'timeSeries/param/save',
      method: 'post',
      data
    })
  },
  // 时序数据计算 详情
  getSequenceDataDetail: function (id) {
    return request({
      url: baseUrl + `timeSeries/param/detail/${id}`,
      method: 'get'
    })
  },
  // 时序数据计算 修改
  updateSequenceData: function (data) {
    return request({
      url: baseUrl + 'timeSeries/param/update',
      method: 'put',
      data
    })
  },
  // 时序数据计算 删除
  deleteSequenceData: function (id) {
    return request({
      url: baseUrl + `timeSeries/param/${id}`,
      method: 'delete'
    })
  },
  // 时序数据绑定 分页列表
  getSequenceDataBindingList: function (data) {
    return request({
      url: baseUrl + 'timeSeries/param/bind/paramBindingList',
      method: 'get',
      params: data
    })
  },
  // 时序数据绑定 绑定
  addSequenceDataBinding: function (data) {
    return request({
      url: baseUrl + 'timeSeries/param/bind/paramBind',
      method: 'post',
      data
    })
  },
  // 时序数据绑定 修改
  updateSequenceDataBinding: function (data) {
    return request({
      url: baseUrl + 'timeSeries/param/bind/updateBinding',
      method: 'put',
      data
    })
  },
  // 时序数据绑定 获取详情
  getSequenceDataBindingDetail: function (id) {
    return request({
      url: baseUrl + `timeSeries/param/bind/getBindById/${id}`,
      method: 'get'
    })
  },
  // 时序数据绑定 删除
  deleteSequenceDataBinding: function (id) {
    return request({
      url: baseUrl + `timeSeries/param/bind/removeBinding/${id}`,
      method: 'delete'
    })
  },
  // 时序数据计算 更新模板状态
  updateSequenceDataStatus: function (params) {
    return request({
      url: baseUrl + 'timeSeries/param/update/state',
      method: 'get',
      params
    })
  }
}
export { apiAnalysis }
